Subnet Protocol Alpha Accounting#2645
Conversation
7a2985d to
de0e9f2
Compare
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE Baseline scrutiny: established opentensor contributor with repo write permission; branch chain-buy-cache -> devnet-ready; no trusted gittensor allowlist hit. Static review only. The PR does not modify FindingsNo findings. ConclusionNo malicious behavior or security vulnerability was found in the reviewed diff. The remaining risk is ordinary runtime-economic correctness risk around the new settlement accounting, which is covered by the Auditor persona rather than a Skeptic finding. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Established opentensor contributor with repo write permission; no trusted Gittensor allowlist hit, but long prior subtensor contribution history supports established-contributor calibration. PR body is substantive and matches the implementation. I did not find a duplicate-work concern among the overlapping open PRs; the overlaps appear to be adjacent subtensor/runtime churn rather than competing implementations. Targeted runtime tests were attempted for the new dissolve/coinbase cases, but the sandboxed toolchain could not run because Findings
ConclusionThe accounting change is directionally consistent with the PR description and has focused tests. The only issue I found is a small but real weight-accounting gap for the added dissolve storage access; it should be fixed before or during merge hardening but does not by itself block this PR. |
| let protocol_alpha_value_u128: u128 = SubnetAlphaIn::<T>::get(netuid) | ||
| .saturating_add(SubnetProtocolAlpha::<T>::get(netuid)) | ||
| .to_u64() as u128; |
There was a problem hiding this comment.
[MEDIUM] Update dissolve weights for protocol-alpha storage
This adds a new SubnetProtocolAlpha read to the dissolve path, and the same function now also removes that map later in the cleanup. The dispatch weights for both dissolve_network and root_dissolve_network in pallets/subtensor/src/macros/dispatches.rs still charge the old reads(6) / writes(31), so the runtime undercharges this path by at least the new protocol-alpha read/write. Please update those annotations or regenerate the relevant weight so the storage proof and DB ops match the new dissolve accounting.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Description
This PR adds protocol-owned alpha accounting for subnet chain buys and includes that alpha in subnet deregistration settlement.